Conversation
95d15db to
55673fb
Compare
Build GCC's three prerequisite libraries using putup with a 3-tree layout (-C/-S/-B) against a read-only GCC source tree. Each library is self-contained with ?= defaults for standalone builds. Per-component tup.config files use prefix-free entries — the directory scope provides the namespace via scoped config merging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
55673fb to
cede70f
Compare
Add libiberty, libdecnumber, libbacktrace, libcpp libraries and the full gcc/ build pipeline (config headers, ~25 generator programs, ~500 backend objects, cc1 link) to the GCC example. The generator bootstrap chain builds genmodes first, then BUILD_RTL support objects, then all RTL generators that produce insn-*.h and insn-*.cc from machine description files. Pre-generated files from gengtype and genmatch are expected in gcc/pre-generated/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
genmatch reads match.pd and generates optimized C++ for GIMPLE and GENERIC IR simplification. It was previously requiring users to run ./configure && make on the GCC source tree to produce its outputs. Now genmatch is compiled and linked against libcpp (for tokenization) and run as part of the normal build. Only gengtype outputs remain in pre-generated/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GCC Example Build — Handoff NoteCurrent StateBuild reaches ~1088/1740 commands before failing. The build command: cd /home/mural/src/pup/examples/gcc && \
PUP_IMPLICIT_DEPS=0 /home/mural/src/pup/build/putup \
-C . -S /home/mural/src/gcc-15.2.0 -B ../../build-gcc -j$(nproc)You need a GCC 15.2.0 source tree at Next Issue to Fix4 generators with file-output flags write relative to CWD (read-only in 3-tree mode) These generators use flags like Affected rules in
Fix: Use the same Key Discoveries (This Build Effort)
WorkflowBuild → read first error → diagnose → fix Tupfile/config → rebuild. Repeat until cc1 links. Separate Issue: 3-Tree Groups BugOrder-only groups produce "has no members" warnings in 3-tree mode. Plan exists at |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add $$ → $ de-escaping in the evaluator so shell variable references survive Tupfile expansion (e.g., for f in $(names); do ... $$f). In 3-tree builds (-C/-S/-B), the scheduler now creates source subdirs that exist in the config tree but not the source tree, enabling packages whose actual source lives in a separate tree (referenced via config variables rather than the -S tree). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Build GNU binutils 2.44 cross-assembler and cross-archiver targeting x86_64-linux from a separate source tree via @(BINUTILS_SRC). This is the first package to use an explicit source variable rather than the implicit -S tree, establishing the pattern for future packages. Single Tupfile builds BFD (38 files), libsframe (2), opcodes (4), gas (39), and ar (11) — producing working as and ar binaries that integrate with the existing xgcc/cc1 toolchain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The pattern required at least one token between the compiler name and -c, so commands like `gcc -c foo.c -o foo.o` never matched. Also add \s as an anchor alternative so compiler wrappers like `ccache gcc` are recognized. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mode The scheduler auto-created source-tree directories when a config-tree directory had no counterpart. This papered over a user setup issue rather than honoring the 3-tree model: config tree mirrors source tree. Makefile.pup now creates the binutils/ directory in the source tree as an explicit setup step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The examples/ directory becomes the BSP root (-C tree). Infrastructure (Tupfile.ini, Tuprules.tup, Makefile.pup, configs/, scripts/) moves up from examples/gcc/. Binutils moves to examples/binutils/ as a peer tarball group. GCC-internal packages stay under examples/gcc/ with a new group Tuprules.tup providing ?= defaults for standalone use. Key changes: - Root Tuprules.tup uses gcc/ prefix for all GCC-tarball DIR variables - Binutils uses $(S)/$(BINUTILS_DIR) instead of @(BINUTILS_SRC) - Nested Tupfile.ini markers removed from busybox/ and helloworld/ - Source assembly model: one source-root/ subdir per extracted tarball Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Core fixes for symlink-safe path resolution in 3-tree mode: canonicalize source/output paths in builder, scheduler, and dag expansion so ../ components resolve correctly from physical CWD. Add parse_scopes to limit Tupfile scanning to requested targets. Add $$ escape for literal dollar signs in shell commands. GCC example cleanup after end-to-end build validation (3511 commands, 0 failures, cc1/cc1plus/xgcc/xg++/cpp all link and run): - Delete dead config/i386/Tupfile (targets/ file compiles same sources) - Fix stale aarch64-apple-darwin HOST_MACHINE in cp/Tupfile - Move driver-i386 compilation to target file, parameterize via TARGET_DRIVER_LINK so non-x86 targets can leave it empty - Rewrite tup.configs for Linux host (basename, sbrk, *_unlocked, etc.) - Add missing BACKTRACE/DECIMAL_FORMAT to aarch64-linux.config - Rewrite binutils/tup.config for Linux, add darwin overlay - Fix Makefile.pup setup-host-configs to handle binutils path
Downloads real GCC 15.2.0 + binutils 2.44 source tarballs and builds the full examples/ BSP using the putup binary from build-linux. Smoke- tests cc1 by compiling a trivial C file to assembly. Also adds PUTUP variable to Makefile.pup so CI can override the binary path without modifying the file.
Drop clang-analyzer-* (path-sensitive symbolic execution — by far the most expensive family). Cherry-pick modernize-* (6 checks) and cppcoreguidelines-* (7 checks) instead of enabling full families. Modeled after DuckDB and Ladybird browser configs. Add 'src/|test/' file filter to run-clang-tidy so third_party TUs are never loaded, eliminating the need for --allow-no-checks and the LLVM 21 apt install (~10 min saved per CI run). Use system clang-tidy-18 from the ubuntu-24.04 runner instead.
- gcc-example SKILL.md: update build command from examples/gcc/ to examples/, remove stale PUP_IMPLICIT_DEPS workaround, update phase list from 7 to 14, fix Phase 6 description, fix scope description - tupfile-patterns SKILL.md: fix root Tuprules example to use gcc/gmp paths matching actual BSP layout - examples/README.md: add Makefile Targets + Variables section, fix Architecture wording (not all dirs have gcc/ prefix), fix Known Limitations (no Tupfile.ini, not $(CC)) - examples/Tupfile: fix stale reference to gcc/gcc/config/i386/Tupfile (now gcc/gcc/targets/x86_64-pc-linux-gnu.tup) - examples/gcc/gcc/Tupfile: update header comment to 14 phases - examples/busybox/README.md: remove deleted Tupfile.ini from table - docs/reference.md: add -C/-S to configure Relevant Options
205fb21 to
06480a0
Compare
Summary
Build a complete GCC 15.2.0 cross-compiler toolchain from source using putup's
3-tree mode. Validates multi-directory builds at scale: 22 Tupfiles, 3511 commands,
8 libraries, 9 executables — all from a single
putupinvocation.What builds
Smoke tested:
cc1 test.c -quietproduces x86_64 assembly withGCC: (Tup) 15.2.0ident.Core changes
expansion so
../components resolve correctly from physical CWD in 3-tree mode$$escape:$$VARin commands passes$VARto shell (matches tup behavior)build-gcc/gcc/genpredsputup configurecopies subdirtup.configfiles to build treeis_path_in_scope: strip trailing separators for correct scope matchingBuild features demonstrated
-C), GCC sources (-S), and build output (-B) in separate treestup.configwith?=defaults for standalone builds<group>into parent link commandstargets/@(TARGET).tupisolates x86_64-specific config, backendobjects, and driver compilation — other targets just provide a different
.tupfile.asm→ m4 → assembler pipeline for GMPconfigs/host-darwin/Test plan